package com.example.cloud.dao.mongdb.system;

import com.example.cloud.model.system.User;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Set;

/**
 * Created by wangtao on 2018/3/4.
 */
@Repository
public interface MongoUserRepository extends MongoRepository<User, Long> {
    User findByUserLoginName(String loginName);
    List<User> findByIdIn(Set<Long> ids);
    List<User> findByAccountIdAndOrganIdInAndJobInAndDeleteFlag(Long accountId, List<Long> ids, List<Integer> jobs, int deleteFlag);
    List<User> findByAccountIdAndOrganIdAndJobAndDeleteFlag(Long accountId, Long organId, int job, int deleteFlag);
    List<User> findByAccountIdAndOrganIdAndIsLogisticsAndDeleteFlag(Long accountId, Long organId, int logis, int deleteFlag);
    List<User> findByAccountIdAndStatusAndDeleteFlag(Long accountId, int status, int deleteFlag);
    List<User> findByAccountIdInAndDeleteFlag(List<Long> ids, int deleteFlag);
    List<User> findByOrganIdAndStatusAndDeleteFlag(Long organId, int status, int deleteFlag);
    List<User> findByStatusAndDeleteFlag(int status, int deleteFlag);
    List<User> findByDepartmentIdAndStatusAndDeleteFlag(Long id, int status, int deleteFlag);
}
